
clear

set matsize 2000

use TimelinePartiesMI_New.dta

sort _couXpar_

merge _couXpar_ using PARTIES_GREEN.dta
drop if polldate==.
drop _merge

sort _couXlegXele_ polldate partyid

* INTERACTIONS WITH NEW TIMELINE VARIABLE

gen tk_left=daysbeforeED_0_001*left
gen tk_right=daysbeforeED_0_001*right
gen tk_centre=daysbeforeED_0_001*centre
gen tk_farleft=daysbeforeED_0_001*farleft
gen tk_farright=daysbeforeED_0_001*farright
gen tk_green=daysbeforeED_0_001*green

**************************************************************************************************************************************************************************************
** APPENDIX S10, NICHE PARTIES - GREEN, FAR-LEFT, FAR-RIGHT **************************************************************************************************************************
**************************************************************************************************************************************************************************************

* TIMELINE + ERROR + ENP + PARTY SIZE + PARTY TRAITS
reg log_ae daysbeforeED_0_001 ipollse pr tk_pr enpp tk_enpp vote_ tk_vote partyold tk_partyold niche tk_niche gov_ tk_gov inc tk_inc 
outreg using EJPR_TabS11, se bdec(3) sigsymb(*,**) starlevels(1 .1) summstat(N \ r2 \ r2_a) summtitle(N \ R-squared \ Adjusted R-squared) ctitle("", "(1)") title("", "Legislative elections") replace

* MULTIPLE IMPUTATION 
mi estimate, post dots: reg log_ae daysbeforeED_0_001 ipollse pr tk_pr enpp tk_enpp vote_ tk_vote partyold tk_partyold niche tk_niche gov_ tk_gov inc tk_inc
outreg using EJPR_TabS11, se bdec(3) sigsymb(*,**,***) starlevels(5 1 .1) summstat(N \ r2 \ r2_a) summtitle(N \ R-squared \ Adjusted R-squared) ctitle("", "(2, Multiply imputed)") title("", "Legislative elections") merge
mibeta log_ae daysbeforeED_0_001 ipollse pr tk_pr enpp tk_enpp vote_ tk_vote partyold tk_partyold niche tk_niche gov_ tk_gov inc tk_inc

* TIMELINE + ERROR + ENP + PARTY SIZE + PARTY TRAITS
reg log_ae daysbeforeED_0_001 ipollse pr tk_pr enpp tk_enpp vote_ tk_vote partyold tk_partyold gov_ tk_gov inc tk_inc green tk_green farleft tk_farleft farright tk_farright   
outreg using EJPR_TabS11, se bdec(3) sigsymb(*,**) starlevels(1 .1) summstat(N \ r2 \ r2_a) summtitle(N \ R-squared \ Adjusted R-squared) ctitle("", "(1)") title("", "Legislative elections") merge

* MULTIPLE IMPUTATION 
mi estimate, post dots: reg log_ae daysbeforeED_0_001 ipollse pr tk_pr enpp tk_enpp vote_ tk_vote partyold tk_partyold gov_ tk_gov inc tk_inc green tk_green farleft tk_farleft farright tk_farright
outreg using EJPR_TabS11, se bdec(3) sigsymb(*,**,***) starlevels(5 1 .1) summstat(N \ r2 \ r2_a) summtitle(N \ R-squared \ Adjusted R-squared) ctitle("", "(2, Multiply imputed)") title("", "Legislative elections") merge
mibeta log_ae daysbeforeED_0_001 ipollse pr tk_pr enpp tk_enpp vote_ tk_vote partyold tk_partyold gov_ tk_gov inc tk_inc tk_green green farleft tk_farleft farright tk_farright  



